package sicnu.cs.aps.schedule;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import sicnu.cs.aps.service.IActivityTeamService;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * TODO
 *
 * @author chenhetao
 * @version 1.0
 * @className TeamStateScheduleService
 * @packageName sicnu.cs.aps.schedule
 * @date 2022/6/8 11:26
 */
@Service
@Slf4j
@RequiredArgsConstructor
public class TeamStateScheduleService {

    private final IActivityTeamService teamService;
    /**
     * TODO 调整执行时间
     * 测试每个5秒执行一次任务(方法)
     */
//    @Scheduled(cron = "*/10 * * * * ?")
    public void teamTimeScheduled() {
        log.info(">>>>>>>>>>>>>>>>>开始更新队伍状态");
        teamService.updateTeamState();
        log.info("更新队伍状态结束<<<<<<<<<<<<<<<<<");
    }


}
